From: Marco Trevisan (TreviƱo) Date: Tue, 17 Feb 2026 14:02:56 +0000 (+0100) Subject: search: Unset the results for the current provider if the new search failed X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~28^2~4^2^2~25 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=4a5b52c05642fbed53ad5b57df0cb5192b71b320;p=gnome-shell.git search: Unset the results for the current provider if the new search failed In case the provider search or subsearch failed, the old results are preserved, while they should be reset or we may show invalid data Part-of: (cherry picked from commit 929c8b821d3b5f5e787d8f1349134ab3e1a4a46a) --- diff --git a/js/ui/search.js b/js/ui/search.js index 1139cbfde..8d9432094 100644 --- a/js/ui/search.js +++ b/js/ui/search.js @@ -693,20 +693,22 @@ export const SearchResultsView = GObject.registerClass({ async _doProviderSearch(provider, previousResults) { provider.searchInProgress = true; - let results; - if (this._isSubSearch && previousResults) { - results = await provider.getSubsearchResultSet( - previousResults, - this._terms, - this._cancellable); - } else { - results = await provider.getInitialResultSet( - this._terms, - this._cancellable); + let results = []; + try { + if (this._isSubSearch && previousResults) { + results = await provider.getSubsearchResultSet( + previousResults, + this._terms, + this._cancellable); + } else { + results = await provider.getInitialResultSet( + this._terms, + this._cancellable); + } + } finally { + this._results[provider.id] = results; + this._updateResults(provider, results); } - - this._results[provider.id] = results; - this._updateResults(provider, results); } _doSearch() {